import {Component} from '@angular/core';
import {NavController, NavParams} from 'ionic-angular';
import {LoginPage} from "../login/login";

import {AllServicePage} from "../all-service/all-service";
import {NewForestPage} from "../new-forest/new-forest";
import {AppointmentCleaningPage} from '../appointment-cleaning/appointment-cleaning';
import {LampblackCleaningPage} from '../lampblack-cleaning/lampblack-cleaning';
import {HerNannyPage} from "../her-nanny/her-nanny";
import {Hero} from "../../provider/home";

import {Home, HomeProvider} from "../../providers/home/home";
import {HttpClient} from "@angular/common/http";


@Component({
    selector: 'page-home',
    templateUrl: 'home.html'
})

export class HomePage {

    /*title = 'Tour of Heroes';
    heroes = [
        new Hero(1, 'Windstorm'),
        new Hero(13, 'Bombasto'),
        new Hero(15, 'Magneta'),
        new Hero(20, 'Tornado')
    ];
    myHero = this.heroes[0];*/


    home: Home;
    constructor(public navCtrl: NavController,
                public navParams: NavParams,
                private http: HttpClient,
                private homePro: HomeProvider) {
    }

    ionViewDidLoad() {
        this.homePro.getData().subscribe((data) => {
            this.home = <Home>data;
        });
        console.log('ionViewDidLoad MyInfoPage');
    }

    login() {
        this.navCtrl.push(LoginPage)
    }

    public allservice() {
        this.navCtrl.push(AllServicePage)
    }

    public newforest() {
        this.navCtrl.push(NewForestPage)
    }

    public clean() {
        this.navCtrl.push(AppointmentCleaningPage)
    }

    public lampblack() {
        this.navCtrl.push(LampblackCleaningPage)
    }

    public nanny() {
        this.navCtrl.push(HerNannyPage)
    }


}
